package learnonline.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import learnonline.dao.TeacherDao;
import learnonline.dao.impl.TeacherDaoImpl;
import learnonline.entity.Teacher;

@WebServlet("/teachermanage")
public class TeaacherManageServlet extends HttpServlet{

	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		TeacherDao teacherdao = new TeacherDaoImpl();
		String name = (String) req.getSession().getAttribute("username");
		Teacher teacher =teacherdao.fetchBy(name);
		req.setAttribute("teacher", teacher);
		req.getRequestDispatcher("/teachermanage.jsp").forward(req, resp);
	}
}
